/**
 * 关于我们
 * @author Qasim <15750783791@163.com>
 * @version 2016/10/31 1.0
 */
document.addEventListener('plusready' , ready , false);

function ready(){
	
	//获取数据
	$.ajax({
		type:"post",
		url:apiRoot + "/Home/Setting/about/",
		dataType : 'json',
	  	beforeSend: function(){
	     	plus.nativeUI.showWaiting('请求中...');
	    },
		complete: function(){    
			plus.nativeUI.closeWaiting();    
		},
		success : function(data){
			if(data){
				$('.logo').attr('src' , getImgUrl(data.logo))
				if(data.name)$('.name').text(data.name)
				//获取当前版本
				plus.runtime.getProperty(plus.runtime.appid, function(wgtinfo){
					version = wgtinfo.version;
					$('.version').text(wgtinfo.version); 
				});
				if(data.phone)$('.phone').text(data.phone);
				$('.call').on('click' , function(){
					plus.nativeUI.confirm('温馨提示: 	确定要拨打该电话吗？' , function(e){
			 			if(e.index == 0){
			 				plus.device.dial( data.phone, true );
			 			}
			 		} , '电子阅读' , ['确定' , '取消'])
				})
				if(data.email)$('.email').text(data.email);
				if(data.url)$('.url').text(data.url);
			}
		},
		error : function(e){
			errorPrompt(e);
		}
	});
	
}
